package com.castle.fortress.admin.dify.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.castle.fortress.admin.dify.model.entity.DifyApiConfig;
import com.castle.fortress.admin.dify.model.enums.DifyConfigTypeEnum;
import com.castle.fortress.admin.dify.service.DifyApiConfigService;
import com.castle.fortress.admin.dify.mapper.DifyApiConfigMapper;
import org.springframework.stereotype.Service;

/**
* @author fkrbl
* @description 针对表【dify_api_config】的数据库操作Service实现
* @createDate 2025-09-28 11:38:18
*/
@Service
public class DifyApiConfigServiceImpl extends ServiceImpl<DifyApiConfigMapper, DifyApiConfig>
    implements DifyApiConfigService {
    @Override
    public DifyApiConfig getConfigByType(DifyConfigTypeEnum type) {
        QueryWrapper<DifyApiConfig> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type",type.getCode());
        return this.getOne(queryWrapper);
    }
}




